﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using COFE.Core.Lister;
using COFE.Core;

namespace COFE.IO.COFEWS
{
    public class COFEWSRootPropertyProvider : PropertyProviderBase
    {

        #region Constructor

        public COFEWSRootPropertyProvider(COFEWSDirectoryLister lister, string listerKey,
            string relativeRootUri)
        {

            RegisterMethod(COFEWSProperties.ListUri, (p) => relativeRootUri);            

            RegisterMethod(FileSystemInfoProperties.FullParseName,
                (p) => String.Format("{{{0}}}", listerKey));

            RegisterMethod(FileSystemInfoProperties.ParentParseName, (p) => null);            
            RegisterMethod(FileSystemInfoProperties.Name, (p) => listerKey);
            RegisterMethod(FileSystemInfoProperties.Label, (p) => listerKey);

            RegisterMethod(FileSystemInfoProperties.IsExists, (p) => true);
            RegisterMethod(FileSystemInfoProperties.IsFileSystem, (p) => false);

            RegisterMethod(FileSystemInfoProperties.FileAttributes,
                (p) => COFE.Core.FileAttributes.ReadOnly | COFE.Core.FileAttributes.Directory);                
            RegisterMethod(FileSystemInfoProperties.COFEAttributes, 
                (p) => COFEAttributes.Browsable);
            
            RegisterMethod(FileSystemInfoProperties.CreationTimeUtc, (p) => DateTime.MinValue );
            RegisterMethod(FileSystemInfoProperties.LastAccessTimeUtc, (p) => DateTime.MinValue);
            RegisterMethod(FileSystemInfoProperties.LastWriteTimeUtc, (p) => DateTime.MinValue);
            RegisterMethod(DirectoryInfoProperties.DirectoryType, (p) => DirectoryTypeEnum.dtVolume);
            RegisterMethod(DirectoryInfoProperties.IsFileBasedFS, (p) => false);
        }

        #endregion

        #region Methods

        #endregion

        #region Data

        COFEWSDirectoryLister _lister;

        #endregion

        #region Public Properties
       

        #endregion

    }
}
